/*
 *  libKara - Library for basic instant messaging functions
 *  Copyright (C) 2007 Markus Karnik
 *
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 3 of the License, 
 *  or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 *
 *  You should have received a copy of the GNU General Public License along 
 *  with this program; if not, see <http://www.gnu.org/licenses/>.
 *  
 */
package de.karnik.libkara.pluginspecs;

import de.karnik.libkara.roster.ImContact;
import de.karnik.libkara.roster.ImMessage;

/**
 * The protocol listener interface for protocol callbacks.
 * 
 * @author Markus Karnik - markus.karnik@my-design.org
 * @version 1.0
 * @since 1.0
 */
public interface ProtocolListener {

	/**
	 * Invoked when the account of the given account id is connected.
	 * 
	 * @param accountID The id of the connected account.
	 */
	public void connected( String accountID );
	/**
	 * Invoked when the account of the given account id is disconnected.
	 * 
	 * @param accountID The id of the disconnected account.
	 */
	public void disconnected( String accountID );
	
	/**
	 * Invoked when the roster was received completely. 
	 */
	public void rosterReceived();
	/**
	 * Invoked when a contact of the roster was received.
	 * 
	 * @param contact The received contact.
	 */
	public void contactReceived( ImContact contact );
	/**
	 * Invoked when a contact status changed.
	 * 
	 * @param userID The user id of the contact.
	 * @param status The new status.
	 * @param statusMessage The new status message.
	 */
	public void contactStatusChanged( String userID, int status, String statusMessage );
	/**
	 * Invoked when a new message arrived.
	 * 
	 * @param userID The user id of the sender.
	 * @param message The message object.
	 */
	public void messageArrived( String userID, ImMessage message );
}
